<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        .box {
            width: 170px;
            height: 200px;
            margin: 100px auto;
        }

        i {
            display: block;
            float: left;
            width: 20px;
            height: 20px;
            border: 1px solid #ccc;
            font-style: normal;
            font-size: 23px;
            text-align: center;
            line-height: 18px;
            color: #ccc;
            cursor: pointer;
        }

        .box2 {
            float: left;
            width: 150px;
            height: 200px;
            background-color: #ccc;
        }
    </style>
</head>

<body>
    <div class="box">
        <i class="close_btn">×</i>
        <div class="box2"></div>
    </div>
    <script>
        var box = document.querySelector('.box');
        var btn = document.querySelector('.close_btn');
        btn.onclick = function() {
            box.style.display = 'none';
        }
    </script>
</body>

</html>